package com.stan.core.spark.userAction;

import java.io.Serializable;

public class ComparableSessionObject
        implements Comparable<ComparableSessionObject>,Serializable {
    String sessionId;
    String categoryId;
    Long top10ClickCategoryCount;

    public String getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public Long getTop10ClickCategoryCount() {
        return top10ClickCategoryCount;
    }

    public void setTop10ClickCategoryCount(Long top10ClickCategoryCount) {
        this.top10ClickCategoryCount = top10ClickCategoryCount;
    }

    @Override
    public int compareTo(ComparableSessionObject o) {
        return (int)((this.top10ClickCategoryCount - o.top10ClickCategoryCount)%1000);
    }

    @Override
    public String toString() {
        return "ComparableSessionObject{" +
                "sessionId='" + sessionId + '\'' +
                ", categoryId='" + categoryId + '\'' +
                ", top10ClickCategoryCount=" + top10ClickCategoryCount +
                '}';
    }
}
